import store from "@/store";

// 判断按钮是否有权限
export default {
    mounted(el, binding) {
        const { value } = binding;
        if (value && value instanceof Array && value.length > 0) {
            const modelList = store.state.permissionList
            const hasPermission = modelList.some(role => value.includes(role));
            if (!hasPermission) {
                el.parentNode && el.parentNode.removeChild(el);
            }
        }
    }
}
